(window["webpackJsonppwa-genicon"] =
  window["webpackJsonppwa-genicon"] || []).push([
  [0],
  {
    100: function (e, a, t) {
      e.exports = t(169);
    },
    106: function (e, a, t) {},
    107: function (e, a, t) {},
    169: function (e, a, t) {
      "use strict";
      t.r(a);
      var n = t(1),
        i = t.n(n),
        o = t(4),
        l = t.n(o),
        c = (t(105), t(106), t(87)),
        r = t(88),
        s = t(97),
        A = t(89),
        m = t(98),
        E = (t(107), t(174)),
        u = t(171),
        d = t(175),
        g = t(172),
        h = t(173),
        p = t(67),
        C = t.n(p),
        f = E.a.Group,
        v = u.a.Option,
        Q = (function (e) {
          function a(e) {
            var t;
            return (
              Object(c.a)(this, a),
              ((t = Object(s.a)(this, Object(A.a)(a).call(this, e))).state = {
                sizeOptions: [
                  { label: "128x128", value: "128" },
                  { label: "144x144", value: "144" },
                  { label: "192x192", value: "192" },
                  { label: "256x256", value: "256" },
                  { label: "512x512", value: "512" },
                ],
                size: [],
                downList: [],
                imgData: null,
                upSize: "",
                favDisable: !0,
                favSize: "32",
                downFav: [],
              }),
              t
            );
          }
          return (
            Object(m.a)(a, e),
            Object(r.a)(a, [
              {
                key: "handleFileFieldChange",
                value: function (e) {
                  var a = e.target.files[0],
                    t = new FormData();
                  if (
                    (t.append("img", a),
                    this.setState({ imgData: t }),
                    this.sizeImg)
                  ) {
                    this.sizeImg.src = URL.createObjectURL(a);
                    var n = this;
                    this.sizeImg.onload = function () {
                      n.setState({ upSize: this.width + " x " + this.height });
                    };
                  }
                },
              },
              {
                key: "handleCheckboxSizeClick",
                value: function (e) {
                  this.setState({ size: e });
                },
              },
              {
                key: "handleBtnGenClick",
                value: function () {
                  var e = this,
                    a = this.state,
                    t = a.imgData,
                    n = a.size,
                    i = a.upSize,
                    o = a.favDisable,
                    l = a.favSize;
                  return t instanceof FormData && t.get("img")
                    ? i && i.split(" x ")[0] != i.split(" x ")[1]
                      ? d.a.error(
                          "\u9009\u62e9\u7684\u56fe\u7247\u7684\u5206\u8fa8\u7387\u5bbd\u3001\u9ad8\u4e0d\u4e00\u81f4"
                        )
                      : o && !n.length
                      ? d.a.error("\u8fd8\u6ca1\u9009\u62e9\u5c3a\u5bf8")
                      : (d.a.loading("\u5f00\u59cb\u751f\u6210", 1.5),
                        void this.setState(
                          {
                            downList: n.map(function (e) {
                              return { size: e, loading: !0, url: "" };
                            }),
                            downFav: o
                              ? []
                              : [{ size: l, loading: !0, url: "" }],
                          },
                          function () {
                            n.map(function (a, n) {
                              fetch(
                                "https://apis.leping.fun/gen-image/?size=" + a,
                                { method: "POST", body: t }
                              )
                                .then(function (e) {
                                  return e.clone().blob();
                                })
                                .then(function (a) {
                                  var t = URL.createObjectURL(a),
                                    i = e.state.downList;
                                  (i[n].loading = !1),
                                    (i[n].url = t),
                                    e.setState({ downList: i });
                                });
                            }),
                              e.state.downFav.map(function (a, n) {
                                fetch(
                                  "https://apis.leping.fun/gen-image/?type=ico&size=" +
                                    a.size,
                                  { method: "POST", body: t }
                                )
                                  .then(function (e) {
                                    return e.clone().blob();
                                  })
                                  .then(function (a) {
                                    var t = URL.createObjectURL(a),
                                      n = e.state.downFav;
                                    (n[0].loading = !1),
                                      (n[0].url = t),
                                      e.setState({ downFav: n });
                                  });
                              });
                          }
                        ))
                    : d.a.error("\u8fd8\u6ca1\u4e0a\u4f20\u56fe\u7247");
                },
              },
              {
                key: "render",
                value: function () {
                  var e = this,
                    a = this.state,
                    t = a.sizeOptions,
                    n = a.imgData,
                    o = a.upSize,
                    l = a.downList,
                    c = a.favDisable,
                    r = a.favSize,
                    s = a.downFav;
                  return i.a.createElement(
                    "div",
                    { className: "App" },
                    i.a.createElement(
                      "div",
                      { className: "App-header" },
                      "Manifest \u56fe\u6807\u751f\u6210\u5de5\u5177"
                    ),
                    i.a.createElement(
                      "div",
                      { className: "App-box" },
                      i.a.createElement(
                        "div",
                        {
                          style: {
                            display: "flex",
                            justifyContent: "space-between",
                            alignItems: "center",
                          },
                        },
                        i.a.createElement(
                          g.a,
                          {
                            placement: "rightTop",
                            title:
                              "\u8bf7\u4e0a\u4f20 .png \u683c\u5f0f\u7684\u56fe\u7247",
                          },
                          i.a.createElement(
                            h.a,
                            {
                              icon: "upload",
                              accept: ".png",
                              onClick: function () {
                                e.fieldImg && e.fieldImg.click();
                              },
                            },
                            "\u4e0a\u4f20\u56fe\u7247"
                          )
                        ),
                        i.a.createElement(
                          "a",
                          {
                            style: { fontSize: ".8em" },
                            href: "https://leping.blog.csdn.net/article/details/78911091",
                            target: "_blank",
                          },
                          "\u5982\u4f55\u914d\u7f6e\uff1f"
                        )
                      ),
                      n instanceof FormData &&
                        n.get("img") &&
                        i.a.createElement(
                          "div",
                          { className: "App-up-img" },
                          i.a.createElement("img", {
                            src: URL.createObjectURL(n.get("img")),
                          }),
                          i.a.createElement(
                            "div",
                            null,
                            i.a.createElement(
                              "div",
                              null,
                              i.a.createElement("b", null, n.get("img").name)
                            ),
                            i.a.createElement(
                              "div",
                              null,
                              i.a.createElement(
                                "small",
                                null,
                                o,
                                " \u50cf\u7d20"
                              )
                            )
                          )
                        ),
                      i.a.createElement(
                        "div",
                        { style: { margin: "15px 0" } },
                        i.a.createElement(f, {
                          options: t,
                          onChange: function (a) {
                            return e.handleCheckboxSizeClick(a);
                          },
                        })
                      ),
                      i.a.createElement(
                        "div",
                        { style: { margin: "15px 0" } },
                        i.a.createElement(
                          E.a,
                          {
                            onChange: function (a) {
                              e.setState({ favDisable: !a.target.checked });
                            },
                          },
                          "\u751f\u6210 favicon.ico"
                        ),
                        i.a.createElement(
                          u.a,
                          {
                            defaultValue: r,
                            style: { width: 100 },
                            disabled: c,
                            onChange: function (a) {
                              e.setState({ favSize: a });
                            },
                          },
                          i.a.createElement(v, { value: "16" }, "16x16"),
                          i.a.createElement(v, { value: "32" }, "32x32"),
                          i.a.createElement(v, { value: "48" }, "48x48"),
                          i.a.createElement(v, { value: "64" }, "64x64"),
                          i.a.createElement(v, { value: "128" }, "128x128")
                        )
                      ),
                      i.a.createElement(
                        "div",
                        { style: { textAlign: "center" } },
                        i.a.createElement(
                          h.a,
                          {
                            shape: "round",
                            type: "primary",
                            icon: "thunderbolt",
                            onClick: function () {
                              return e.handleBtnGenClick();
                            },
                          },
                          "\u751f\u6210"
                        )
                      ),
                      (!!l.length || !!s.length) &&
                        i.a.createElement("div", { className: "App-hr" }),
                      i.a.createElement(
                        "div",
                        { className: "App-down" },
                        Array.isArray(l) &&
                          l.map(function (a, t) {
                            return i.a.createElement(
                              "div",
                              { className: "App-up-img", key: t },
                              i.a.createElement("img", { src: a.url || C.a }),
                              i.a.createElement(
                                "div",
                                null,
                                i.a.createElement(
                                  "div",
                                  null,
                                  i.a.createElement(
                                    "span",
                                    null,
                                    a.size,
                                    " x ",
                                    a.size
                                  ),
                                  i.a.createElement(
                                    h.a,
                                    {
                                      loading: a.loading,
                                      icon: "download",
                                      onClick: function () {
                                        e.aDown &&
                                          ((e.aDown.href = a.url),
                                          (e.aDown.download = a.size + ".png"),
                                          e.aDown.click());
                                      },
                                    },
                                    a.loading
                                      ? "\u8f6c\u6362\u4e2d"
                                      : "\u4e0b\u8f7d"
                                  )
                                )
                              )
                            );
                          }),
                        Array.isArray(s) &&
                          s.map(function (a, t) {
                            return i.a.createElement(
                              "div",
                              { className: "App-up-img", key: t },
                              i.a.createElement("img", { src: a.url || C.a }),
                              i.a.createElement(
                                "div",
                                null,
                                i.a.createElement(
                                  "div",
                                  null,
                                  i.a.createElement(
                                    "span",
                                    null,
                                    a.size,
                                    " x ",
                                    a.size,
                                    " favicon.ico"
                                  ),
                                  i.a.createElement(
                                    h.a,
                                    {
                                      loading: a.loading,
                                      icon: "download",
                                      onClick: function () {
                                        e.aDown &&
                                          ((e.aDown.href = a.url),
                                          (e.aDown.download = "favicon.ico"),
                                          e.aDown.click());
                                      },
                                    },
                                    a.loading
                                      ? "\u8f6c\u6362\u4e2d"
                                      : "\u4e0b\u8f7d"
                                  )
                                )
                              )
                            );
                          })
                      ),
                      i.a.createElement(
                        "div",
                        { className: "App-copyright" },
                        " ",
                        " ",
                        i.a.createElement(
                          "a",
                          {
                            href: "https://github.com/gitmfq",
                            target: "_blank",
                          },
                          "gitMFQ"
                        )
                      )
                    ),
                    i.a.createElement(
                      "div",
                      { className: "App-hiden" },
                      i.a.createElement("input", {
                        className: "Add-file",
                        type: "file",
                        ref: function (a) {
                          return (e.fieldImg = a);
                        },
                        onChange: function (a) {
                          return e.handleFileFieldChange(a);
                        },
                        accept: "image/png",
                      }),
                      i.a.createElement("img", {
                        ref: function (a) {
                          return (e.sizeImg = a);
                        },
                      }),
                      i.a.createElement("a", {
                        href: "",
                        ref: function (a) {
                          return (e.aDown = a);
                        },
                      })
                    )
                  );
                },
              },
            ]),
            a
          );
        })(i.a.Component),
        I = Boolean(
          "localhost" === window.location.hostname ||
            "[::1]" === window.location.hostname ||
            window.location.hostname.match(
              /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
            )
        );
      function w(e, a) {
        navigator.serviceWorker
          .register(e)
          .then(function (e) {
            e.onupdatefound = function () {
              var t = e.installing;
              null != t &&
                (t.onstatechange = function () {
                  "installed" === t.state &&
                    (navigator.serviceWorker.controller
                      ? (console.log(
                          "New content is available and will be used when all tabs for this page are closed. See https://bit.ly/CRA-PWA."
                        ),
                        a && a.onUpdate && a.onUpdate(e))
                      : (console.log("Content is cached for offline use."),
                        a && a.onSuccess && a.onSuccess(e)));
                });
            };
          })
          .catch(function (e) {
            console.error("Error during service worker registration:", e);
          });
      }
      l.a.render(i.a.createElement(Q, null), document.getElementById("root")),
        (function (e) {
          if ("serviceWorker" in navigator) {
            if (
              new URL(".", window.location.href).origin !==
              window.location.origin
            )
              return;
            window.addEventListener("load", function () {
              var a = "".concat(".", "/service-worker.js");
              I
                ? (!(function (e, a) {
                    fetch(e)
                      .then(function (t) {
                        var n = t.headers.get("content-type");
                        404 === t.status ||
                        (null != n && -1 === n.indexOf("javascript"))
                          ? navigator.serviceWorker.ready.then(function (e) {
                              e.unregister().then(function () {
                                window.location.reload();
                              });
                            })
                          : w(e, a);
                      })
                      .catch(function () {
                        console.log(
                          "No internet connection found. App is running in offline mode."
                        );
                      });
                  })(a, e),
                  navigator.serviceWorker.ready.then(function () {
                    console.log(
                      "This web app is being served cache-first by a service worker. To learn more, visit https://bit.ly/CRA-PWA"
                    );
                  }))
                : w(a, e);
            });
          }
        })();
    },
    67: function (e, a) {
      e.exports =
        "";
    },
  },
  [[100, 1, 2]],
]);
